package com.buyingtickets.service.impl;

import com.buyingtickets.dao.TypeDao;
import com.buyingtickets.entity.Type;
import com.buyingtickets.service.TypeBiz;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.List;
@Service
public class TypeBizImpl implements TypeBiz {
    @Resource
    private TypeDao typeDao;

    public List<Type> queryByDingDanZhuangTai() {
        return typeDao.queryByDingDanZhuangTai();
    }

    @Override
    public List<Type> queryByChePiaoZhuangTai() {
        return typeDao.queryByChePiaoZhuangTai();
    }

    @Override
    public int queryByClassAndName(String tclass, String tname) {
        if(StringUtils.hasText(tclass)&&StringUtils.hasText(tname)){
            return typeDao.queryByClassAndName(tclass,tname);
        }
        return 0;
    }

    @Override
    public List<Type> queryByCalss(String tclass) {
        return typeDao.queryByCalss(tclass);
    }
}
